package com.simple_factory;
/**
 * 简单工厂
 *
 */
public class simplePhoneFactory {
    public static Phone createPhoneme(String type){
        if(type.equals("old")){
            return new oldPhone();
        }
        else if(type.equals("smart")) {
            return new smartPhone();
        }
        else{
            throw new RuntimeException("没有这个类型得手机");
        }
    }
}
